import 'package:flutter_test/flutter_test.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:amap_flutter_map/amap_flutter_map_platform_interface.dart';
import 'package:amap_flutter_map/amap_flutter_map_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAmapFlutterMapPlatform
    with MockPlatformInterfaceMixin
    implements AmapFlutterMapPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AmapFlutterMapPlatform initialPlatform = AmapFlutterMapPlatform.instance;

  test('$MethodChannelAmapFlutterMap is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAmapFlutterMap>());
  });

  test('getPlatformVersion', () async {
    AmapFlutterMap amapFlutterMapPlugin = AmapFlutterMap();
    MockAmapFlutterMapPlatform fakePlatform = MockAmapFlutterMapPlatform();
    AmapFlutterMapPlatform.instance = fakePlatform;

    expect(await amapFlutterMapPlugin.getPlatformVersion(), '42');
  });
}
